*WHAT'S ACROSS THE BORDER?
*JHA, NEUMARK, AND RODRIGUEZ-LOPEZ

include directories.do


* Load data at the national-20industry level
use "`cbpdir'`s'cbp_national_20ind_1990_2016.dta", replace

keep if year==1990 | year==2016

keep year sic87xx sic87xx_desc wageap shareemp
gen epwap=wageap*2.087 
reshape wide wageap epwap shareemp, i(sic87xx) j(year)
egen wagerank90=rank(wageap1990), track
egen wagerank16=rank(wageap2016), track
order sic87xx sic87xx_desc shareemp1990 epwap1990 wagerank90 shareemp2016 epwap2016 wagerank16
sort wagerank90
drop wageap1990 wageap2016

export excel using "`outdir'`s'TablesJNR.xlsx", sheetreplace sheet(TableA1)

clear all

